<?php
namespace Common\TagLib;
use Think\Template\TagLib;

class Base extends TagLib {

	protected $tags = array(
		'getField'  => array('attr' => 'model,where,order,field', 'close' => 0)
	);

	public function _getField($tags) {
		$model = $tags['model'];
		$field = $tags['field'];
		$where = $tags['where'] ? $tags['where'] : '';
		$order = $tags['order'] ? $tags['order'] : '';
		if ($where) $map['_string'] = $where;
		$map['status'] = 1;
		return M($model)->where($map)->order($order)->getField($field);
	}

}